package com.six.core.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 
 * @TableName sto_order
 */
@TableName(value ="sto_order")
@Data
public class Order implements Serializable {
    /**
     * 
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 订单id
     */
    private String orderid;

    /**
     * 下单人
     */
    private Integer userid;

    /**
     * 下单店铺id
     */
    private Integer shopid;

    /**
     * 商品id
     */
    private String goodsid;

    /**
     * 商品数量
     */
    private Integer goodsnum;

    /**
     * 收货地址
     */
    private String receiveid;

    /**
     * 支付金额
     */
    private Double pay;

    /**
     * 总价
     */
    private Double totalprice;

    /**
     * 支付类型（0：微信 1：支付宝）
     */
    private Integer paytype;

    /**
     * 支付状态 0 支付成功 1 未支付
     */
    private Integer paystate;

    /**
     * 发货状态 0 已发货 1未发货  2已收货
     */
    private Integer sendstate;

    /**
     * 逻辑删除 1（true）已删除， 0（false）未删除
     */
    @TableField(value = "is_deleted",fill = FieldFill.INSERT)//添加时自动填充
    private Integer isDeleted;

    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    @TableField(value = "gmt_create",fill = FieldFill.INSERT)
    private Date gmtCreate;

    /**
     * 更新时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    @TableField(value = "gmt_modified" , fill=FieldFill.INSERT_UPDATE)
    private Date gmtModified;

    /**
     * 评价状态 0 已评价 1 未评价
     */
    private Integer remarkstate;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Order other = (Order) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getOrderid() == null ? other.getOrderid() == null : this.getOrderid().equals(other.getOrderid()))
            && (this.getUserid() == null ? other.getUserid() == null : this.getUserid().equals(other.getUserid()))
            && (this.getShopid() == null ? other.getShopid() == null : this.getShopid().equals(other.getShopid()))
            && (this.getGoodsid() == null ? other.getGoodsid() == null : this.getGoodsid().equals(other.getGoodsid()))
            && (this.getGoodsnum() == null ? other.getGoodsnum() == null : this.getGoodsnum().equals(other.getGoodsnum()))
            && (this.getReceiveid() == null ? other.getReceiveid() == null : this.getReceiveid().equals(other.getReceiveid()))
            && (this.getPay() == null ? other.getPay() == null : this.getPay().equals(other.getPay()))
            && (this.getTotalprice() == null ? other.getTotalprice() == null : this.getTotalprice().equals(other.getTotalprice()))
            && (this.getPaytype() == null ? other.getPaytype() == null : this.getPaytype().equals(other.getPaytype()))
            && (this.getPaystate() == null ? other.getPaystate() == null : this.getPaystate().equals(other.getPaystate()))
            && (this.getSendstate() == null ? other.getSendstate() == null : this.getSendstate().equals(other.getSendstate()))
            && (this.getIsDeleted() == null ? other.getIsDeleted() == null : this.getIsDeleted().equals(other.getIsDeleted()))
            && (this.getGmtCreate() == null ? other.getGmtCreate() == null : this.getGmtCreate().equals(other.getGmtCreate()))
            && (this.getGmtModified() == null ? other.getGmtModified() == null : this.getGmtModified().equals(other.getGmtModified()))
            && (this.getRemarkstate() == null ? other.getRemarkstate() == null : this.getRemarkstate().equals(other.getRemarkstate()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getOrderid() == null) ? 0 : getOrderid().hashCode());
        result = prime * result + ((getUserid() == null) ? 0 : getUserid().hashCode());
        result = prime * result + ((getShopid() == null) ? 0 : getShopid().hashCode());
        result = prime * result + ((getGoodsid() == null) ? 0 : getGoodsid().hashCode());
        result = prime * result + ((getGoodsnum() == null) ? 0 : getGoodsnum().hashCode());
        result = prime * result + ((getReceiveid() == null) ? 0 : getReceiveid().hashCode());
        result = prime * result + ((getPay() == null) ? 0 : getPay().hashCode());
        result = prime * result + ((getTotalprice() == null) ? 0 : getTotalprice().hashCode());
        result = prime * result + ((getPaytype() == null) ? 0 : getPaytype().hashCode());
        result = prime * result + ((getPaystate() == null) ? 0 : getPaystate().hashCode());
        result = prime * result + ((getSendstate() == null) ? 0 : getSendstate().hashCode());
        result = prime * result + ((getIsDeleted() == null) ? 0 : getIsDeleted().hashCode());
        result = prime * result + ((getGmtCreate() == null) ? 0 : getGmtCreate().hashCode());
        result = prime * result + ((getGmtModified() == null) ? 0 : getGmtModified().hashCode());
        result = prime * result + ((getRemarkstate() == null) ? 0 : getRemarkstate().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", orderid=").append(orderid);
        sb.append(", userid=").append(userid);
        sb.append(", shopid=").append(shopid);
        sb.append(", goodsid=").append(goodsid);
        sb.append(", goodsnum=").append(goodsnum);
        sb.append(", receiveid=").append(receiveid);
        sb.append(", pay=").append(pay);
        sb.append(", totalprice=").append(totalprice);
        sb.append(", paytype=").append(paytype);
        sb.append(", paystate=").append(paystate);
        sb.append(", sendstate=").append(sendstate);
        sb.append(", isDeleted=").append(isDeleted);
        sb.append(", gmtCreate=").append(gmtCreate);
        sb.append(", gmtModified=").append(gmtModified);
        sb.append(", remarkstate=").append(remarkstate);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}